import { BigNumber } from 'bignumber.js'

export function toWei(amount: BigNumber, decimals: number) {
    const base = new BigNumber(10)
    const wei = amount.multipliedBy(base.pow(decimals))
    return wei.toFixed(0, 1)
}

export function fromWei(amount: BigNumber, decimals: number) {
    const base = new BigNumber(10, 10)
    return amount.div(base.pow(decimals))
}
